home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1998 February
/
Macworld (1998-02).dmg
/
Inside Macworld
/
Alphamania 2 & Effector Sets
/
AlphaMania 2
/
Set FX.dir
/
00121_Script_CheckBox Button
< prev
next >
Wrap
Text File
|
1997-12-19
|
2KB
|
69 lines
property pSpriteNum, pStatus, pActive, pCallBackObj, pRefcon
on new me, proplist
set pSpriteNum = getAProp(proplist,#sprite)
set pStatus = getAProp(proplist,#cur)
set pActive = getAProp(proplist,#active)
set pCallBackObj = getAProp(proplist,#callback)
set pRefcon = getAProp(proplist,#ref)
SetUp(me, pStatus)
SetEnabled(me,pActive)
return(me)
end
on Click me, sNum
if not pActive then exit
if not integerP(sNum) then set sNum = the clickOn
if the memberNum of sprite sNum < 1 then exit
if not (the name of the member of sprite sNum contains "checkBox") then exit
put the name of the member of sprite sNum into memName
set the member of sprite sNum = member (memName&&"Down")
updateStage
set selected = TRUE
repeat while the stillDown
if rollover(sNum) then
set the member of sprite sNum = member (memName&&"Down")
set selected = TRUE
else
set the member of sprite sNum = member (memName)
set selected = FALSE
end if
updateStage
end repeat
SetUp(me,not pStatus)
if objectP(pCallBackObj) then
CheckBox(pCallBackObj, pRefcon, pStatus)
end if
return(pStatus)
end
on SetUp me, newNum
set pStatus = newNum
refresh(me)
end
on refresh me
puppetSprite pSpriteNum, TRUE
if pStatus then
set the member of sprite pSpriteNum = member "checkBox 1"
else
set the member of sprite pSpriteNum = member "checkBox 0"
end if
end
on SetEnabled me, enabled
set pActive = enabled
end
on Release me
puppetSprite pSpriteNum, FALSE
end